home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / autoconf.lha / autoconf-1.4 / configure < prev    next >
Text File  |  1993-05-22  |  8KB  |  239 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  23. # --with-PACKAGE unless this script has special code to handle it.
  24.  
  25.  
  26. for arg
  27. do
  28.   # Handle --exec-prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      # For backward compatibility, also recognize exact --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  53.         no_create=1 ;;
  54.  
  55.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  56.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  57.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  58.     next_prefix=yes ;;
  59.  
  60.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  61.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  62.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  63.     next_srcdir=yes ;;
  64.  
  65.      -with-* | --with-*)
  66.        package=`echo $arg|sed 's/-*with-//'`
  67.        # Delete all the valid chars; see if any are left.
  68.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  69.          echo "configure: $package: invalid package name" >&2; exit 1
  70.        fi
  71.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  72.  
  73.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  74.        verbose=yes ;;
  75.  
  76.      *) ;;
  77.     esac
  78.   fi
  79. done
  80.  
  81. trap 'rm -f conftest* core; exit 1' 1 3 15
  82.  
  83. # Needed for some versions of `tr' so that character classes in `[]' work.
  84. if test "${LANG+set}" = "set" ; then
  85.    LANG=C
  86. fi
  87.  
  88. rm -f conftest*
  89. compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  90.  
  91. # A filename unique to this package, relative to the directory that
  92. # configure is in, which we can look for to find out if srcdir is correct.
  93. unique_file=acgeneral.m4
  94.  
  95. # Find the source files, if location was not specified.
  96. if test -z "$srcdir"; then
  97.   srcdirdefaulted=yes
  98.   # Try the directory containing this script, then `..'.
  99.   prog=$0
  100.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  101.   test "X$confdir" = "X$prog" && confdir=.
  102.   srcdir=$confdir
  103.   if test ! -r $srcdir/$unique_file; then
  104.     srcdir=..
  105.   fi
  106. fi
  107. if test ! -r $srcdir/$unique_file; then
  108.   if test x$srcdirdefaulted = xyes; then
  109.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  110.   else
  111.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  112.   fi
  113.   exit 1
  114. fi
  115. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  116. # But we can't avoid them for `..', to make subdirectories work.
  117. case $srcdir in
  118.   .|/*|~*) ;;
  119.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  120. esac
  121.  
  122. # Make sure to not get the incompatible SysV /etc/install and
  123. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  124. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  125. # or the AFS install, which mishandles nonexistent args, or
  126. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  127. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  128. # anyway.  Sigh.
  129. if test "z${INSTALL}" = "z" ; then
  130.   echo checking for install
  131.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  132.   for dir in $PATH; do
  133.     test -z "$dir" && dir=.
  134.     case $dir in
  135.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  136.     *)
  137.       if test -f $dir/installbsd; then
  138.     INSTALL="$dir/installbsd -c" # OSF1
  139.     INSTALL_PROGRAM='$(INSTALL)'
  140.     INSTALL_DATA='$(INSTALL) -m 644'
  141.     break
  142.       fi
  143.       if test -f $dir/install; then
  144.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  145.       : # AIX
  146.     else
  147.       INSTALL="$dir/install -c"
  148.       INSTALL_PROGRAM='$(INSTALL)'
  149.       INSTALL_DATA='$(INSTALL) -m 644'
  150.       break
  151.     fi
  152.       fi
  153.       ;;
  154.     esac
  155.   done
  156.   IFS="$saveifs"
  157. fi
  158. INSTALL=${INSTALL-cp}
  159. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  160. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  161.  
  162. if test -n "$prefix"; then
  163.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  164.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  165. fi
  166. if test -n "$exec_prefix"; then
  167.   prsub="$prsub
  168. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  169. exec_prefix\\1=\\2$exec_prefix%"
  170. fi
  171. DEFS="`echo \"$DEFS\" | sed 's%[&\\\]%\\\&%g'`"
  172.  
  173. trap 'rm -f config.status; exit 1' 1 3 15
  174. echo creating config.status
  175. rm -f config.status
  176. cat > config.status <<EOF
  177. #!/bin/sh
  178. # Generated automatically by configure.
  179. # Run this file to recreate the current configuration.
  180. # This directory was configured as follows,
  181. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  182. #
  183. # $0 $*
  184.  
  185. for arg
  186. do
  187.   case "\$arg" in
  188.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  189.     exec /bin/sh $0 $* ;;
  190.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  191.   esac
  192. done
  193.  
  194. trap 'rm -f Makefile; exit 1' 1 3 15
  195. INSTALL='$INSTALL'
  196. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  197. INSTALL_DATA='$INSTALL_DATA'
  198. LIBS='$LIBS'
  199. srcdir='$srcdir'
  200. DEFS='$DEFS'
  201. prefix='$prefix'
  202. exec_prefix='$exec_prefix'
  203. prsub='$prsub'
  204. EOF
  205. cat >> config.status <<\EOF
  206.  
  207. top_srcdir=$srcdir
  208.  
  209. # Allow make-time overrides of the generated file list.
  210. test -n "$gen_files" || gen_files="Makefile"
  211.  
  212. for file in .. $gen_files; do if [ "x$file" != "x.." ]; then
  213.   srcdir=$top_srcdir
  214.   # Remove last slash and all that follows it.  Not all systems have dirname.
  215.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  216.   if test "$dir" != "$file"; then
  217.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  218.     test ! -d $dir && mkdir $dir
  219.   fi
  220.   echo creating $file
  221.   rm -f $file
  222.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  223.   sed -e "
  224. $prsub
  225. s%@INSTALL@%$INSTALL%g
  226. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  227. s%@INSTALL_DATA@%$INSTALL_DATA%g
  228. s%@LIBS@%$LIBS%g
  229. s%@srcdir@%$srcdir%g
  230. s%@DEFS@%$DEFS%
  231. " $top_srcdir/${file}.in >> $file
  232. fi; done
  233.  
  234. exit 0
  235. EOF
  236. chmod +x config.status
  237. test -n "$no_create" || ./config.status
  238.  
  239.